<?php

declare(strict_types=1);

/**
 * This file is part of Panda.
 *
 * @link     https://www.yangertao.com
 * @contact  joeyoung0314@qq.com
 * @license  https://github.com/nashgao/mqtt-client
 */

use function Hyperf\Support\env;

return [
    // panda
    'client' => [
        'host' => env('MQTT_CLIENT_HOST', '127.0.0.1'),
        'port' => (int)env('MQTT_CLIENT_PORT', 1883),
        'pool' => [
            'userName' => env('MQTT_CLIENT_USERNAME', ''),
            'password' => env('MQTT_CLIENT_PASSWORD', ''),
            'clientId' => env('MQTT_CLIENT_CLIENT_ID', 'hyperf'), // 客户端id
            'keepAlive' => 60, // 心跳 默认0秒，设置成0代表禁用
            'protocolName' => 'MQTT', // 协议名，默认为MQTT(3.1.1版本)，也可为MQIsdp(3.1版本)
            'protocolLevel' => 4, // 协议等级，MQTT3.1.1版本为4，5.0版本为5，MQIsdp为3
            'properties' => [], // MQTT5 中所需要的属性
            'delay' => 3000, // 重连时的延迟时间 (毫秒)
            'maxAttempts' => 5, // 最大重连次数。默认-1，表示不限制
            'swooleConfig' => []
        ],
    ],
];
